package chapter03

import org.apache.log4j.{Level, Logger}
import org.apache.spark.{SparkConf, SparkContext}
object Test29_cogroup {
  def main(args: Array[String]): Unit = {
    Logger.getLogger("org.apache.spark").setLevel(Level.WARN)
    val conf = new SparkConf().setMaster("local[*]").setAppName("cogroup")
    val sc = new SparkContext(conf)
    val value = sc.makeRDD(List(('a', 1), ('d', 2), ('c', 3)))
    val value1 = sc.makeRDD(List(('a', 5), ('b', 4), ('c', 3)))
    val value2 = value.cogroup(value1)
    println(value2.collect().toList)
  }
}
